package com.pma.TrackMe;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class Main extends Activity {
    /** Called when the activity is first created. */
	
	TextView test;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        initialize();
        start();
    }

    
     //http://developer.android.com/resources/faq/commontasks.html
	private void start() {
		// TODO Auto-generated method stub
		Thread thread = new Thread()
		{
		    @Override
		    public void run() {
		        try {
		            while(true) {
		            	setTextBlank();
		            	sleep(1000);
		            	setText();
		                
		            }
		        } catch (InterruptedException e) {
		            e.printStackTrace();
		        }
		    }
		};

		thread.start();

	}

	private void setText(){
		test.setText("TEST");
	}
	
	private void setTextBlank(){
		test.setText("");
	}
	private void initialize() {
		// TODO Auto-generated method stub
		
		test = (TextView) findViewById(R.id.test);
				
	}
}